package com.ruoyi.web.controller.teaching;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.teaching.service.DataCentreService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 王旭
 * @since 2024-09-09
 */
@RestController
@RequestMapping("/data/centre")
@Api(tags = "platform-数据中心")
public class DataCentreController {
    @Autowired
    private DataCentreService dataCentreService;

    @GetMapping("/combinedSearching")
    @ApiOperation(value = "首页聚合搜索",notes = "首页聚合搜索")
    public AjaxResult combinedSearching(Integer pageNum,Integer pageSize,String projectName) {
        return dataCentreService.combinedSearching(pageNum,pageSize,projectName);
    }

    /**
     * 教师数据概括
     */
    @GetMapping("/teacherData")
    @ApiOperation(value = "教师数据概括",notes = "教师数据概括")
    public AjaxResult teacherData() {
        return dataCentreService.teacherData();
    }

    /**
     * 教师数据概括-发布课程总数详情
     */
    @GetMapping("/teacherCourse")
    @ApiOperation(value = "教师数据概括-发布课程总数详情",notes = "教师数据概括-发布课程总数详情")
    public AjaxResult teacherCourse(Integer studyNumCourseId,Integer studentScoreCourseId, Integer workFinishCourseId) {
        return dataCentreService.teacherCourse(studyNumCourseId,studentScoreCourseId,workFinishCourseId);
    }

    /**
     * 教师数据概括-虚拟仿真实训详情
     */
    @GetMapping("/teacherVirtual")
    @ApiOperation(value = "教师数据概括-虚拟仿真实训详情",notes = "教师数据概括-虚拟仿真实训详情")
    public AjaxResult teacherVirtual(Integer leftVirtualId,Integer rightVirtualId) {
        return dataCentreService.teacherVirtual(leftVirtualId,rightVirtualId);
    }

    /**
     * 教师数据概括-学习课程详情
     */
    @GetMapping("/teacherStudy")
    @ApiOperation(value = "教师数据概括-学习课程详情",notes = "教师数据概括-学习课程详情")
    public AjaxResult teacherStudy(Integer leftCourseId,Integer rightCourseId) {
        return dataCentreService.teacherStudy(leftCourseId,rightCourseId);
    }

    /**
     * 学生数据概括
     */
    @GetMapping("/studentData")
    @ApiOperation(value = "学生数据概括",notes = "学生数据概括")
    public AjaxResult studentData() {
        return dataCentreService.studentData();
    }

    /**
     * 学生数据概括-学习课程详情
     */
    @GetMapping("/studentStudy")
    @ApiOperation(value = "学生数据概括-学习课程详情",notes = "学生数据概括-学习课程详情")
    public AjaxResult studentStudy(Integer leftCourseId,Integer middleCourseId,Integer rightCourseId) {
        return dataCentreService.studentStudy(leftCourseId,middleCourseId,rightCourseId);
    }

    /**
     * 学生数据概括-虚拟仿真详情
     */
    @GetMapping("/studentVirtual")
    @ApiOperation(value = "学生数据概括-虚拟仿真详情",notes = "学生数据概括-虚拟仿真详情")
    public AjaxResult studentVirtual(Integer leftVirtualId,Integer rightVirtualId) {
        return dataCentreService.studentVirtual(leftVirtualId,rightVirtualId);
    }

    /**
     * 学生/普通/企业 用户数据概括-获取虚拟仿真项目下拉框
     */
    @GetMapping("/studentVirtualProject")
    @ApiOperation(value = "学生/普通/企业 用户数据概括-获取虚拟仿真项目下拉框",notes = "学生/普通/企业 用户数据概括-获取虚拟仿真项目下拉框")
    public AjaxResult studentVirtualProject() {
        return dataCentreService.studentVirtualProject();
    }

    /**
     * 普通/企业 用户数据概括
     */
    @GetMapping("/commonEnterpriseData")
    @ApiOperation(value = "普通/企业 用户数据概括",notes = "普通/企业 用户数据概括")
    public AjaxResult commonEnterpriseData(Integer leftId, Integer rightId) {
        return dataCentreService.commonEnterpriseData(leftId,rightId);
    }

    /**
     * 学校管理员数据概括
     */
    @GetMapping("/schoolManagerData")
    @ApiOperation(value = "学校管理员数据概括",notes = "学校管理员数据概括")
    public AjaxResult schoolManagerData(Integer topRightId,Integer middleLeftId) {
        return dataCentreService.schoolManagerData(topRightId,middleLeftId);
    }

    /**
     * 系统管理员数据概括
     */
    @GetMapping("/systemManagerData")
    @ApiOperation(value = "系统管理员数据概括",notes = "系统管理员数据概括")
    public AjaxResult systemManagerData(Integer topRightId,Integer middleMiddleId) {
        return dataCentreService.systemManagerData(topRightId,middleMiddleId);
    }

    /**
     * 首页增加访问量接口
     */
    @GetMapping("/addVisit")
    @ApiOperation(value = "首页增加访问量",notes = "首页增加访问量")
    public void addVisit() {
         dataCentreService.addVisit();
    }

}
